[TESTING] : Gas benchmarks for deploying diamonds#244
[TESTING] : Gas benchmarks for deploying diamonds#244mudgen merged 4 commits intoPerfect-Abstractions:mainfrom
Conversation
👷 Deploy request for compose-diamonds pending review.Visit the deploys page to approve it
|
|
@AnInsaneJimJam This is very valuable information, thank you. I am very glad to see these gas reports. I looked over how you implemented these things. Looks good, good job. You can see why is is failing here: https://github.com/Perfect-Abstractions/Compose/pull/244/checks Maybe it fails because "LibDiamond.sol" doesn't exist anymore in the repo. You don't have to fix this. I mainly need to see the gas statistics data, which I now see, thank you. I generally see that the constructor method is more gas efficient, even though using a memory array, because it is only one transaction instead of two. |
|
Hey @mudgen, I am very happy that you liked my work. I was messing with the code. I tried 1000 facets ( My thoughts were since percentages are converging towards 0, so at 1000 facets it should be almost 0). But I got suprising result that at 1000 facets, Init approach saved gas !!!!!!. So by binary search, I found that at around ~350 facets the percentage is 0, then it starts going negative. I am digging deep into how gas is calculated to figure out why is this happening |
|
@AnInsaneJimJam Cool! Great to experiment. I am pretty sure I know what is happening, but it is very good to discover for yourself.
I am glad to know that 350 facet number. |
|
Thankyou @mudgen .Yeah, I also discovered the reason ( exponential increase in gas with memory use). I think we should merge this into main ( so that anyone can verify the report) and I can help in creating a gas report for our docs website. what do you think? |
That is up to you. I don't think we need to anything further with this PR so I can close it. I needed the data and you did a great job and got the data. However, perhaps you have motivation to have this added to the main branch. Do you want this added to the main branch for some reason? If so is it because you want github to track and show your contribution to this repo? If that is the case then I want you to have that and we can merge in your changes into the main repo. After they are merged in and recorded in the system I'll delete them. Your contribution to the repo will still be recorded and shown by the github system. |
|
@mudgen thank you for understanding. Although that was secondary but still the motivation. It will be great if you do so. |
|
@AnInsaneJimJam Thank you for this very valuable work. Merged into main branch. |
Two Diamond implementations:
Benchmarks